package com.jinyou.chengfengshop.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;
import com.jinyou.chengfengshop.MainActivity;
import com.jinyou.chengfengshop.R;
import com.jinyou.chengfengshop.bean.orderNoBean;

/**
 * 订单详情
 * Created by zhuzhiqiang on 2018/9/25.
 */

public class OrderDetailsActivity extends AppCompatActivity {
    private orderNoBean odb;
    private ImageView order_img;
    private TextView cui_tv;
    private TextView rider_tv;
    private TextView back_tv;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_orderdetails);

        odb = (orderNoBean) getIntent().getSerializableExtra("ORDER");

        order_img = (ImageView) findViewById(R.id.order_img);

        Picasso.with(MainActivity.context)
                .load(odb.getShopImage())
                .into(order_img);

        cui_tv = (TextView) findViewById(R.id.cui_tv);
        cui_tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                                Snackbar.make(v, "暂未开通", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });
        rider_tv = (TextView) findViewById(R.id.rider_tv);
        rider_tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent mIntent = new Intent(getApplicationContext(),RiderAddressActivity.class);
                mIntent.putExtra("info",odb);
                startActivity(mIntent);
            }
        });
        back_tv = (TextView) findViewById(R.id.back_tv);
        back_tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
